Skip to content

Instantly share code, notes, and snippets.

View WooodHead's full-sized avatar

WooodHead

  • Hangzhou
View GitHub Profile
@WooodHead
WooodHead / app.js
Created September 28, 2017 05:07 — forked from dstroot/app.js
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));
@WooodHead
WooodHead / gist:b5fbccf391309efbeb85d70945c0740f
Created October 7, 2017 04:41 — forked from devknoll/gist:8b274f1c5d05230bfade
Basic GraphQL example using the GitHub API
import { graphql, GraphQLString, GraphQLInt } from 'graphql';
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema';
import request from 'promisingagent';
const repositorySortEnum = enumType('RepositorySort')
.value('CREATED', 'created')
.value('UPDATED', 'updated')
.value('PUSHED', 'pushed')
.value('FULL_NAME', 'full_name')
.end();
@WooodHead
WooodHead / apache, php, mysql for MAC OS X 10.11
Created October 8, 2017 02:04 — forked from aichbauer/apache, php, mysql for MAC OS X 10.11
How to install or run apache, php, and mysql on Mac OSX 10.11 with the Terminal
/**ALLOW HIDDEN FOLDER**/
defaults write com.apple.finder AppleShowAllFiles YES
sudo killall Finder
/**APACHE**/
sudo apachectl start
sudo apachectl stop
sudo apachectl restart
@WooodHead
WooodHead / gist:9c736ada85c7c263aafbd56821a9bd75
Created October 9, 2017 04:36 — forked from jasonrudolph/gist:6057563
GitHub Search API: Get the number of stars for a repository

James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"

Example

$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
@WooodHead
WooodHead / tomorrow.style
Created October 9, 2017 13:58 — forked from chrislopresto/tomorrow.style
MWeb Tomorrow Preview CSS Theme
editor
foreground: cccccc
background: 2d2d2d
caret: cc99cc
editor-selection
foreground: ffffff
background: 515151
H1
@WooodHead
WooodHead / gist:ecce5fd67de73cc6410da1489c211636
Created October 12, 2017 10:35 — forked from nghuuphuoc/gist:8282411
Install wkhtmltopdf on Centos 6 x64
$ wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
// In case you got the issue
// wkhtmltopdf: error while loading shared libraries:
// libfontconfig.so.1: cannot open shared object file: No such file or directory
//
// run the command below:
$ yum install urw-fonts libXext libXrender fontconfig libfontconfig.so.1
@WooodHead
WooodHead / incomes_controller.rb
Created October 14, 2017 08:05 — forked from boriscy/incomes_controller.rb
Print to PDF using phantomjs
# Example controller
class IncomesController < ApplicationController
# Include the print
include Controllers::Print
# GET /incomes/1
def show
@income = present Income.find(params[:id])
respond_to do |format|
@WooodHead
WooodHead / crawler.py
Created November 4, 2017 03:18 — forked from vinovator/crawler.py
Crawl a page and extract all urls recursively within same domain
# crawler.py
# Python 2.7.6
"""
Crawl a page and extract all urls recursively within same domain
"""
from BeautifulSoup import BeautifulSoup
@WooodHead
WooodHead / url_scrape.py
Created November 4, 2017 03:23 — forked from falkben/url_scrape.py
scrapes a website for all the URLs below it
''' scrapes a website for urls '''
import requests
from bs4 import BeautifulSoup
class URLTest():
def __init__(self, link, status_code, current_depth, head):
self.link = link
self.status_code = status_code
@WooodHead
WooodHead / a.md
Created November 4, 2017 03:57 — forked from mala/a.md
Chrome ExtensionのLive HTTP Headersの調査(CoolBar.Pro導入 Extensionが何を行うかの調査)

Chrome ExtensionのLive HTTP Headersを調査した。Firefox用のものではない。Firefox用のものではない。

11/7追記

English version: https://translate.google.com/translate?sl=ja&tl=en&js=y&prev=_t&hl=ja&ie=UTF-8&u=https%3A%2F%2Fgist.github.com%2Fmala%2Fe87973df5029d96c9269d9431fcef5cb&edit-text=&act=url

Summary in english.