This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
if (isset($argv[1])) { | |
$lista = file($argv[1]); | |
$total = count($lista) - 1; | |
echo $lista[mt_rand(1, $total)]; | |
} else { | |
echo "Passe uma lista de nomes como parâmetro!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $1 ] | |
then | |
mkdir -p lib/vendor | |
wget http://www.symfony-project.org/get/symfony-1.4.13.tgz | |
tar -zxvf symfony-1.4.13.tgz | |
mv symfony-1.4.13 lib/vendor/symfony | |
rm symfony-1.4.13.tgz | |
php lib/vendor/symfony/data/bin/symfony generate:project $1 | |
php symfony generate:app frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "${GIT_BRANCH}" == "origin/master" ] | |
then | |
do stuff | |
else | |
do other stuff | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Github Suggestion Box | |
--------------------- | |
Please, put your suggestions here. Octocat thanks you! | |
* Discussion module for each repository, allowing contributors and users to discuss various aspects of the repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( $var == 'crazy' && $foo != 'bar' ) | |
seems very unreadable for me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define FFI_SCOPE "SDL" | |
#define FFI_LIB "libSDL2.so" | |
typedef uint8_t Uint8; | |
typedef uint16_t Uint16; | |
typedef uint32_t Uint32; | |
typedef uint64_t Uint64; | |
extern int SDL_Init(Uint32 flags); | |
extern int SDL_InitSubSystem(Uint32 flags); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require '../vendor/autoload.php'; | |
$request = Symfony\Component\HttpFoundation\Request::createFromGlobals(); | |
$context = (new Symfony\Component\Routing\RequestContext())->fromRequest($request); | |
$configLocator = new Symfony\Component\Config\FileLocator(__DIR__ . '/../config'); | |
$file = '../var/cache/container.php'; | |
if (\file_exists($file)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
import urllib.request | |
import re | |
namespaces = {'nhc': 'http://www.nhc.noaa.gov'} | |
# Drill: https://www.nhc.noaa.gov/rss_examples/index-at-20130605.xml | |
xml = urllib.request.urlopen('https://www.nhc.noaa.gov/index-at.xml').read() | |
root = ET.fromstring(xml) | |
hurricane = root[0].find('item/nhc:Cyclone', namespaces) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter table books | |
add constraint books_doc_isbn_ok | |
check( | |
doc->>'ISBN' is not null and | |
jsonb_typeof(doc->'ISBN') = 'number' and | |
(doc->>'ISBN')::bigint > 0 and | |
length(doc->>'ISBN') = 13 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Copyright <2021> <Lexxicon Studios LLC.> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
software and associated documentation files (the "Software"), to deal in the Software | |
without restriction, including without limitation the rights to use, copy, modify, | |
merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
and to permit persons to whom the Software is furnished to do so, subject to the | |
following conditions: | |
The above copyright notice and this permission notice shall be included in all copies | |
or substantial portions of the Software. |
OlderNewer