Skip to content

Instantly share code, notes, and snippets.

View juneym's full-sized avatar

Raul Martinez Jr juneym

  • Carparts.com Inc
  • Torrance, CA
  • 15:10 (UTC -08:00)
View GitHub Profile
@juneym
juneym / capture.js
Created January 9, 2016 07:08 — forked from gaspanik/capture.js
Take screenshot at single viewport size using CasperJS
var screenshotUrl = 'http://example.com/'
var casper = require("casper").create({
viewportSize: {
width: 1024,
height: 768
}
});
if (casper.cli.args.length < 1) {
@juneym
juneym / screenshots.js
Created January 9, 2016 07:04 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@juneym
juneym / Castle.xml
Created December 20, 2015 09:09 — forked from kwmt/Castle.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@juneym
juneym / Castle.xml
Created December 20, 2015 09:09 — forked from bemasher/Castle.xml
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@juneym
juneym / http_serv.go
Last active October 22, 2015 05:19 — forked from gotnix/http_serv.go
Share you directory via http server by golang.
package main
import (
"flag"
"fmt"
"log"
"net/http"
"strconv"
)
<?php
interface SubscriberInterface {
public static function getSubscribedEvents();
}
class BlogSubscriber implements SubscriberInterface {
public static function getSubscribedEvents() {
return array(
'blog_update' => 'Listener'
);
@juneym
juneym / client.py
Created September 25, 2015 12:17 — forked from gdamjan/client.py
Python 3.5 async/await with aiohttp, parallel or sequential
import aiohttp
import asyncio
async def get_body(url):
response = await aiohttp.request('GET', url)
raw_html = await response.read()
return raw_html
async def main():
# run them sequentially (but the loop can do other stuff in the meanwhile)
@juneym
juneym / Makefile.golang
Last active August 29, 2015 14:27 — forked from dnishimura/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@juneym
juneym / gist:88c8286e68d0088eb444
Last active September 2, 2015 10:22 — forked from justincase/gist:5492212
Enable mgo debug log
mgo.SetDebug(true)
var aLogger *log.Logger
aLogger = log.New(os.Stderr, "", log.LstdFlags)
mgo.SetLogger(aLogger)
@juneym
juneym / mgoExample.go
Last active August 29, 2015 14:26 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {