Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
# | |
# Powershell script for adding/removing/showing entries to the hosts file. | |
# | |
# Known limitations: | |
# - does not handle entries with comments afterwards ("<ip> <host> # comment") | |
# | |
$file = "C:\Windows\System32\drivers\etc\hosts" | |
function add-host([string]$filename, [string]$ip, [string]$hostname) { |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# CodeIgniter Setup Script by Kevin Remisoski - (old could use some work as noted below) | |
# Work to be done: | |
# 1. Merge hosts.pl | |
# 2. Create menu with support for various frameworks and multi-level for various versions | |
# 3. Support for grunt, bower, npm, etc.. | |
# Dependencies - git > http://git-scm.com/ && hosts.pl > https://gist.github.com/markembling/173887 | |
# This is just a powershell script I created. I just learned powershell a little bit in the last 15 minutes, and thought I'd modify an existing batch file I created to take care of some more advanced features I wanted. |
/** | |
* conc() Console Comments w/ print_r support by Faisalman | |
* | |
* @author Kevin Remisoski <[email protected]> | |
* @license http://www.opensource.org/licenses/mit-license.php | |
* @link https://gist.github.com/Kr3m/cfeb326cd63db2befa83a629dbc1b24a | |
* usage: conc(msg, output) e.g. conc('Hello World!', var); | |
* to do: remove redundancies (e.g. isArr) | |
*/ | |
var conc = function(msg = null, output = null) { |
#!/bin/bash | |
# I'm hoping this helps you as much as it helped me. | |
# If you're without sound and maybe just upgraded Ubuntu... | |
# Try this out and then try your sound settings again. | |
pulseaudio -k && sudo alsa force-reload |
Recently I was asked to generate PDF invoices for an online shop. I looked at various PHP PDF generators, but wasn't particularly impressed with any of them.
Then I found (via Stack Overflow) a command-line HTML-to-PDF convertor called wkhtmltopdf, which uses WebKit (the same layout engine as Safari and Google Chrome) and therefore is very accurate.
There is a class for PHP integration on the Wiki, but I found it overly complicated and it uses temp files which aren't necessary. This is the code I wrote instead.
I used Smarty for generating the HTML for the PDF, but you can use any template engine, or pure PHP if you prefer.
Note: I originally tried to install wkhtmltopdf from source, but it's much easier to use the static binary instead.
<?php | |
/** | |
* Exception handling class. | |
*/ | |
class EnvatoException extends Exception { | |
} | |
public function Parse ($url) { | |
$fileContents= file_get_contents($url); | |
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); | |
$fileContents = trim(str_replace('"', "'", $fileContents)); | |
$simpleXml = simplexml_load_string($fileContents); | |
$json = json_encode($simpleXml); | |
return $json; | |
} |
private static void TestDialogue() | |
{ | |
var dialogue = GameDialogue.DialogueList; | |
for (var i = 0; i < dialogue.Count; i++) | |
{ | |
var current = dialogue[i]; | |
var ouputs = current.OutputIds; | |
var currentOutputCount = current.OutputIds.Count; |