Skip to content

Instantly share code, notes, and snippets.

View nullset2's full-sized avatar

Alfredo Gallegos nullset2

View GitHub Profile
import java.io.*;
import java.util.*;
public class IceCreamParlor{
public static void main(String[] args) throws IOException {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine().trim());
for(int i=0; i<t; i++){
@nullset2
nullset2 / ArrangeToGreater.java
Last active August 20, 2017 03:59
ArrangeToGreater.java
import java.util.Arrays;
import java.util.Comparator;
class ArrangeToGreater{
private static Integer[] numbers = {5, 2, 1, 9, 50, 56};
public static void main(String[] args){
Arrays.sort(numbers, new Comparator<Integer>() {
@Override
public int compare(Integer l, Integer r) {
<%@ page import="blog.Post" %>
<%@ page import="blog.Tag" %>
<div class="fieldcontain ${hasErrors(bean: post, field: 'title', 'error')} ">
<label for="title">
<g:message code="post.title.label" default="Title" />
</label>
<g:textField name="title" value="${post.title}" />
</div>
package blog
class Tag {
String name
Date dateCreated
Date lastUpdated
static belongsTo = Post
static hasMany = [posts: Post]
package blog
class Post {
String title
String content
Date dateCreated
Date lastUpdated
static hasMany = [tags: Tag]
@nullset2
nullset2 / convert.sh
Created May 23, 2017 18:41
convert all svg files to png with real png transparency
find . -type f -name '*.svg' -exec mogrify -density 500 -resize 20% -background none -fill rgba(0,0,0,0) -opaque black -format png {} \;
find . -type f -name '*.html' -exec sed -i '' -e 's/svg/png/g' {} \;
alfredo@Kurisu   ~  chmod 600 test.txt  ✓  13:30:07
alfredo@Kurisu   ~  ll  ✓  13:30:08
total 4.0K
...
-rw------- 1 alfredo staff 0 Nov 4 12:49 test.txt
...
alfredo@Kurisu   ~  cat test.txt  ✓  13:30:08  ✓  13:30:12
alfredo@Kurisu   ~   ✓  13:30:12
alfredo@Kurisu   ~  chmod a-r test.txt  ✓  12:56:31
alfredo@Kurisu   ~  ll  ✓  12:56:33
total 4.0K
...
--w------- 1 alfredo staff 0 Nov 4 12:49 test.txt
...
alfredo@Kurisu   ~  cat test.txt  ✓  12:59:12
cat: test.txt: Permission denied
alfredo@Kurisu   ~  touch test.txt  ✓  12:49:42
alfredo@Kurisu   ~  ls -l  2 ↵  12:49:49
total 4
...
-rw-r--r-- 1 alfredo staff 0 Nov 4 12:49 test.txt
...
@nullset2
nullset2 / permissions
Created November 4, 2016 18:10
file permissions example
alfredo@Kurisu   ~  ls -l  ✓  12:09:46
total 4
drwx------ 5 alfredo staff 170 May 25 09:44 Applications
-rw-r--r-- 1 alfredo staff 1803 Oct 21 11:38 CCP-Dev-openrc.sh
drwx------+ 13 alfredo staff 442 Nov 4 12:09 Desktop
drwx------+ 16 alfredo staff 544 Nov 4 09:13 Documents
drwx------+ 10 alfredo staff 340 Nov 4 10:39 Downloads
drwx------+ 72 alfredo staff 2448 Oct 12 00:09 Library
drwx------+ 6 alfredo staff 204 Jul 4 00:37 Movies
drwx------+ 6 alfredo staff 204 Jun 16 23:06 Music