Skip to content

Instantly share code, notes, and snippets.

View bsorrentino's full-sized avatar
💭
passion is fuel for life

bsorrentino bsorrentino

💭
passion is fuel for life
View GitHub Profile
@bsorrentino
bsorrentino / index.html
Last active December 11, 2015 03:28
A CodePen by Adem ilter. Countdown Clock
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<style></style>
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body class="play">
<div class="container">
@bsorrentino
bsorrentino / CodeAnalisysProcessor.java
Last active December 23, 2015 10:29
JSR269 - Java Annotation Processor - Find method usage
@SuppressWarnings("restriction")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes( "*" )
@SupportedOptions( {"method"} )
public class CodeAnalisysProcessor extends AbstractProcessor {
public class Analisys extends TreePathScanner<Object,Trees> {
final String method;
@bsorrentino
bsorrentino / 0_reuse_code.js
Created October 21, 2013 16:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
//
// How to use:
//
// 1. Start node:
// node nodeproxy.js
// 2. Send a URL like this:
// http://localhost:8080/http://www.google.com
//
// Watch www.google.com come through your local HTTP proxy.
//
@bsorrentino
bsorrentino / CSS3-Switch.markdown
Created March 12, 2014 23:11
A Pen by Yiwei Ma.
@bsorrentino
bsorrentino / NSRunLoop.m
Last active May 17, 2016 10:28
IOS unit test: Make a REST call and wait for result
- (void)testMBRequest
{
NSURL *url = ....;
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
MBJSONRequest *jsonRequest = [[MBJSONRequest alloc] init];
__block BOOL loaded = NO;
[jsonRequest performJSONRequest:urlRequest completionHandler:^(id responseJSON, NSError *error) {
// ### removeRecursive, copyRecursive when/promise compliant
// NodeJS:
// Delete a file or delete a DIR recursively
// be aware that this is a power full delete function
// so best is to check if the PATH given is really
// the path you want to DELETE ENTIRELY
//
// Copy DIR to another location recursively
//
// ### usage example
package org.bsc.jna;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.ShellAPI;
import com.sun.jna.platform.win32.ShellAPI.APPBARDATA;
import com.sun.jna.platform.win32.WinDef.DWORD;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.UINT_PTR;
@bsorrentino
bsorrentino / j2objc.rb
Last active June 21, 2017 13:33
J2OBJC FORMULA (HOMEBREW)
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
# /usr/local/Library/Contributions/example-formula.rb
#
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
#
# FOR LOCAL INSTALLATION COPY IT IN /usr/local/Library/Formula/
#
class J2objc < Formula
homepage "http://j2objc.org/"
@bsorrentino
bsorrentino / eclipse-notnull-template.md
Last active January 24, 2019 09:45
Eclipse template (code snippet ) to check the argument and eventually throws IllegalArgumentException
  1. Download Gist
  2. Open Eclipse Preferences
  3. Go to Java/Editor/templates
  4. Click Import