Skip to content

Instantly share code, notes, and snippets.

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="false" CopySettingsToSystemAcct="false"/>
</gs:UserList>
<gs:InputPreferences>
<gs:InputLanguageID Action="add" ID="0409:00000409"/>
<gs:InputLanguageID Action="add" ID="0809:00000809"/>
<gs:InputLanguageID Action="add" ID="0409:00000809"/>
<gs:InputLanguageID Action="add" ID="0809:00000409"/>
</gs:InputPreferences>
@thomasruiz
thomasruiz / truiz.zsh-theme
Last active March 3, 2017 11:02
My own zsh theme
local return_code="%(?..%{$fg[red]%}%? %{$reset_color%})"
PROMPT='%{$fg[blue]%}{ %c } \
%{$fg[green]%}$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "" )%{$reset_color%} \
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
@thomasruiz
thomasruiz / .zshrc
Created June 6, 2016 11:12
RM alias to confirm when directory has a git repository
rm() {
export RM_VALIDATION='y'
for i
do
if [[ $i[1] != '-' ]]; then
if [[ -n `find $i -name .git` ]]; then
echo -n "There is a git repository. Are you sure? (y/N) "
read RM_VALIDATION
@thomasruiz
thomasruiz / nginx.conf
Last active January 27, 2016 13:44
redirect all http requests and www.* requests to https://host.name/ (from @jaw-sh)
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
@thomasruiz
thomasruiz / day7.php
Created December 7, 2015 10:55
/!\ Spoil advent of code
<?php
$i = file('i');
$z = [];
foreach ($i as $s) {
$r = explode(' -> ', $s);
$z[trim($r[1])] = trim($r[0]);
}
/* PART 2 (REMOVE THIS LINE FOR PART 1) */
<?php
$l = str_repeat('0', 1000000);
$i = file('i');
foreach ($i as $s) {
$tok = strtok($s, ' ');
$instruction = 1;
$c = '';
if ($tok === 'toggle') {
$instruction = 0;
<?php
$i = 'yzbqklnj';
$n = 0;
while (strpos(md5("$i$n"), "000000") !== 0) { ++$n; }
echo $n;
public function addDependency($package, $version, $dev = false)
{
$devOption = $dev ? '--dev' : null;
$command = "composer require $devOption --prefer-dist $package";
$process = new Process($command);
$process->run(/* ... */);
}