Skip to content

Instantly share code, notes, and snippets.

View siathalysedI's full-sized avatar
🎯
Focusing

Arnstein Henriksen siathalysedI

🎯
Focusing
View GitHub Profile
@pfmiles
pfmiles / DropinTemplateLexer.java
Created April 22, 2012 14:34
Java enumerable lexer example, using capturing groups.
public class DropinTemplateLexer {
private static final String LINE_SEP = System.getProperty("line.separator");
private static final char NL = '\n';
/**
* lexer rules
*
* <pre>
* ESCAPED ::= '\\\\#|\\\\\\$'
@aschroder
aschroder / gist:2469319
Created April 23, 2012 07:17
Magento REST API PHP test harness (admin and customer)
<?php
/**
* Copyright Magento 2012
* Example of products list retrieve using Customer account via Magento
REST API. OAuth authorization is used
*/
$callbackUrl = "http://yourhost/oauth_customer.php";
$temporaryCredentialsRequestUrl =
"http://magentohost/oauth/initiate?oauth_callback=" .
urlencode($callbackUrl);
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@benclark
benclark / default.vcl
Created May 14, 2012 17:17
Varnish config file w/ basic auth
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
acl purge {
"localhost";
@g3d
g3d / gist:2709563
Last active January 9, 2025 17:35 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@fideloper
fideloper / vhost.py
Last active June 17, 2024 11:58
Create vHost Ubuntu Lamp-Server (bash and python)
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@jamtur01
jamtur01 / generate_navigation.rb
Created May 20, 2012 21:28
Auto-generates navigation menu for Jekyll sites using pages based on subdirectories and contents
# Auto-generates navigation
# {% generate_navigation %}
#
require 'pathname'
module Jekyll
class Page
def source_path
File.join(@dir, @name).sub(%r{^/*},'')
@siathalysedI
siathalysedI / 7segmentos.cpp
Created June 10, 2012 09:42 — forked from yesidays/7segmentos.cpp
Leer y escribir en display de 7 segmentos
#include <stdio.h>
#include <conio.h>
int main(void){
int i,j,k,cont;
char c;
int x[]={6,91,79,102,109,124,7,127,103,63};
int y[]={119,124,57,94,121,113,125,118,6,14,56,63,115,109,62,110};
char user[]={'a','b','c','d','e','f','g','h','i','j','l','o','p','s','u','y'};
char aux[5];
char cam[5];
@mah0001
mah0001 / curl-partial-download.php
Created June 15, 2012 01:23
Partial downloading of files using CURL with PHP
/**
*
* Using CURL to download partial content from a URL
*
* @url file URL to download
* @range_start Start range in bytes
* @range_end End range in bytes
*
*
* example: curl_get_content("http://www.example.org/some-file.zip",100,500)
@kellyrob99
kellyrob99 / KulerScraper.groovy
Created June 17, 2012 19:34
Reads RSS feeds from Adobe kuler site and extracts the hexadecimal representation of each five element theme, writing those values to a file.
/**
* Reads RSS feeds from kuler and extracts the hexadecimal representation of each five element theme, writing those
* values to a file.
*/
def feeds = [
new URL("http://kuler-api.adobe.com/feeds/rss/get.cfm?itemsPerPage=100&listType=rating"),
new URL("http://kuler-api.adobe.com/feeds/rss/get.cfm?itemsPerPage=100&listType=popular")
]
def mappedThemes = [:]
def slurp = {rssXML, themes ->