Skip to content

Instantly share code, notes, and snippets.

@HaiNguyen007
HaiNguyen007 / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
@HaiNguyen007
HaiNguyen007 / designer.html
Created November 13, 2014 21:15
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
Here are all the classes from Bootstrap 3 (version 3.1.1).
Method of extraction:
1. Download Bootstrap 3 and rename bootstrap.css as "bootstrap.html"
2. Add the following 24 lines of code to the very bottom of the bootstrap.html file:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script>
@HaiNguyen007
HaiNguyen007 / l10n_server.xml
Created June 14, 2015 09:37 — forked from raphaelhuefner/l10n_server.xml
Cache of https://localize.drupal.org/l10n_server.xml to be used in drush make files via defaults[projects][l10n_url] = {URL of this gist}
<?xml version="1.0" encoding="UTF-8"?>
<l10n_server><version>1.1</version><name>Translations</name><link>http://localize.drupal.org/</link><update_url>http://ftp.drupal.org/files/translations/%core/%project/%project-%release.%language.po</update_url><l10n_remote>http://localize.drupal.org/</l10n_remote><languages><language><name>Afghanistan Persian</name><native>دری</native><code>prs</code></language><language><name>Afrikaans</name><native>Afrikaans</native><code>af</code></language><language><name>Albanian</name><native>Shqip</native><code>sq</code></language><language><name>Amharic</name><native>አማርኛ</native><code>am</code></language><language><name>Arabic</name><native>العربية</native><code>ar</code></language><language><name>Armenian</name><native>Հայերեն</native><code>hy</code></language><language><name>Assamese</name><native>Assamese</native><code>as</code></language><language><name>Asturian</name><native>Asturianu</native><code>ast</code></language><language><name>Azerbaijani</name><native>azərbaycan</
#!/usr/bin/env ruby
# a quick, simple script to partially parse output from https://github.com/trivio/common_crawl_index/blob/master/bin/remote_read
# and output subdomains in order of count
url_counts = {}
total_urls = 0
File.readlines(ARGV[0]).each do |line|
url = line.split(' ').first
reverse_hostname = url.split('/').first
@HaiNguyen007
HaiNguyen007 / image-shortcode.php
Created February 25, 2016 01:36 — forked from kovshenin/image-shortcode.php
Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/
@HaiNguyen007
HaiNguyen007 / gist:8cee9d1c6ca0f977294284a8c589366e
Created November 14, 2016 14:53 — forked from fmitchell/gist:6079933
Migrate example using migrate, migrate_d2d, migrate_extras
<?php
/**
* This is example code for a Drupal 6 to Drupal 7 migration. This won't actually
* work without defining the referenced vocabularies, content types, and fields
* on each side.
*/
/**
* Implements hook_flush_caches().
# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html | grep "https://dl.humble.com" | sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' | sed 's/&amp;/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list | awk '{print $2}' | uniq | xargs -I"{}" mkdir -p /tmp/humble_books/{} && cat /tmp/humble_books_list | awk '{print "curl -o /tmp/humble_books/" $2 "/" $2 "." $3 " \"" $1 "\"" }' | while read line; do eval $line; done
@HaiNguyen007
HaiNguyen007 / prepareSheets.js
Created August 2, 2017 21:55 — forked from misterfresh/prepareSheets.js
Add an Update button to the Dashboard for React Drive CMS
// This script is intended for use with https://github.com/misterfresh/react-drive-cms
// Add it as a bound script to the Dashboard Sheet file
function onOpen() {
var dashboard = SpreadsheetApp.getActiveSpreadsheet();
var updateDashboard = [{name: "Update Dashboard", functionName: "prepareSheets"}];
dashboard.addMenu("Update", updateDashboard);
}
function prepareSheets() {
'use strict';
var Preparator = {
@HaiNguyen007
HaiNguyen007 / CopyAsanaTasks.php
Created August 26, 2017 03:32 — forked from AWeg/CopyAsanaTasks.php
main changes: - Asana has own SSL cert -> had to add to lines of code - copies subtasks and up to 11 subtasks of subtasks - copies tags -> only tagnames not followers/descriptions
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null)
{
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api
$url = "https://app.asana.com/api/1.0/$methodPath";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($ch, CURLOPT_USERPWD, $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);