View Language War
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
/* | |
[DESAFIO / LANGUAGE WAR] Implemente um programa na sua linguagem favorita onde o usuário digita um número x, e o programa calcula o somatório dos x primeiros números pares da sequência fibonacci, e imprime a soma dos algarismos desse número. | |
Por exemplo, quando x = 5, a resposta é 17, pois: | |
1. A sequência fibonacci é 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,... | |
2. Os 5 primeiros números pares são 0, 2, 8 e 34, 144. | |
3. O somatório disso é 188. | |
4. Somando os algarismos, 1+8+8 = 17 |
View postgresql clone schema
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
-- Function: clone_schema(text, text, text) | |
-- DROP FUNCTION clone_schema(text, text, text); | |
CREATE OR REPLACE FUNCTION clone_schema(source_schema text, dest_schema text, dest_owner text) | |
RETURNS void AS | |
$BODY$ | |
DECLARE | |
seq RECORD; |
View Lisp 0.0.0.1
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
#Creates a named function using the script block. | |
function Add-Function( | |
[string]$name, | |
[Parameter(ValueFromPipeline=$true)] | |
[ScriptBlock]$block) | |
{ | |
New-Item -Path "Function:" -Name "global:$name" -Value $block | |
} |
View gist:c6927904ef5cc99fb5cf
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
Penetration Testing Execution Standard | |
http://www.pentest-standard.org/index.php | |
ISIS Lab's Hack Night - An Intense Introduction to Offensive Security | |
https://github.com/isislab/Hack-Night/ | |
FSU Offensive Computer Security | |
http://www.cs.fsu.edu/~redwood/OffensiveComputerSecurity ( 2014 ) | |
http://www.cs.fsu.edu/~redwood/OffensiveSecurity ( 2013 ) |
View gist:2466dc1aca84a3a02357
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
$packages = (git diff --name-only $env:TRAVIS_COMMIT_RANGE) | | |
? { $_ -like "conda/*" } | | |
% { $_ | split-path -leaf } | | |
group | % { $_.name } | |
write-host "Packages to be built: $packages" | |
foreach ( $pkg in $packages ) | |
{ | |
foreach ( $python in $env:PYTHON ) | |
{ | |
conda build "conda/$pkg" --python $python |
View peano.cpp
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
template<typename T> | |
struct S { | |
typedef T Previous; | |
enum { ToInt = T::ToInt + 1 }; | |
}; | |
struct Z { enum { ToInt = 0 }; }; | |
template<typename T> |
View peano_complex.cpp
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
//Lets create an arithmetic by using templates, why not? | |
//We're not allowed to use builtin compiler math operations | |
//Yes, this uses sifinae | |
struct Z { | |
enum { ToInt = 0 }; | |
}; | |
template<typename T> | |
struct S { |
View CSS binary number encoder
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
input:not(:checked) + input:not(:checked) + input:not(:checked) + input:checked + | |
div:before { | |
content: "1"; | |
} | |
input:not(:checked) + input:not(:checked) + input:checked + input:not(:checked) + | |
div:before { | |
content: "2"; | |
} | |
input:not(:checked) + input:not(:checked) + input:checked + input:checked + | |
div:before { |
View profunctor.cs
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
//https://ocharles.org.uk/blog/guest-posts/2013-12-22-24-days-of-hackage-profunctors.html | |
//http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html | |
//https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/profunctors | |
public interface Variant { } | |
public interface CoVariant { } | |
public interface Profunctor<P> | |
{ | |
P p { get; } |
View sort_by_pk.cs
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
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Entity; | |
using System.Data.Entity.Core; | |
using System.Data.Entity.Core.Mapping; | |
using System.Data.Entity.Core.Metadata.Edm; | |
using System.Data.Entity.Core.Objects; | |
using System.Data.Entity.Core.Objects.DataClasses; | |
using System.Data.Entity.Infrastructure; | |
using System.Data.Linq; |
OlderNewer